//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using EntLibContrib.Resource.Configuration.Design;
using EntLibContrib.Resource.Configuration.Design.Generators;

#if !NUNIT
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
#endif

namespace EntLibContrib.Resource.Configuration.Design.Tests
{
	/// <summary>
	/// Summary description for StronglyTypedBuilderHelperFixture
	/// </summary>
	[TestClass]
	public class StronglyTypedBuilderHelperFixture
	{
		private static string configFile = "EntLibContrib.Resource.Configuration.Design.Tests.dll.config";
		private static string instance = "ResourceManager1";
		private static string internalInstance = "InternalResourceFactory";
		private static string namespaceName = "Test";
		private static string className = "Resources";
		private static string csClassFileName = "TestResources.cs";
		private static string vbClassFileName = "TestResources.vb";
		private static string internalClassFileName = "InternalResources.cs";

		[TestMethod]
		public void GenerateCSClass()
		{
			StronglyTypedResourceBuilderHelper.GenerateClass(configFile, instance, namespaceName, className, csClassFileName);
			FileInfo fi = new FileInfo(csClassFileName);
			Assert.IsTrue(fi.Exists);
		}

		[TestMethod]
		public void GenerateVBClass()
		{
			StronglyTypedResourceBuilderHelper.GenerateClass(configFile, instance, namespaceName, className, vbClassFileName);
			FileInfo fi = new FileInfo(vbClassFileName);
			Assert.IsTrue(fi.Exists);
		}

		[TestMethod]
		public void GenerateInternalClass()
		{
			StronglyTypedResourceBuilderHelper.GenerateClass(configFile, internalInstance, namespaceName, className, internalClassFileName);
			FileInfo fi = new FileInfo(internalClassFileName);
			Assert.IsTrue(fi.Exists);
		}
	}
}
